﻿<%@ Page Language="C#" MasterPageFile="~/Pages/Site.master" 
    CodeBehind="SelectCustomer.aspx.cs" Inherits="Nydus.WebForms.Frontend.Pages.SelectCustomer" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Identify customer
    </h2>
    <p>
        <asp:Label AssociatedControlID="txtCustomerId" Text="Enter customer id: " runat="server" />
        <asp:TextBox ID="txtCustomerId" runat="server" />
    </p>
    <p>
        <asp:Label AssociatedControlID="txtCustomerName" Text="Enter customer name: " runat="server" />
        <asp:TextBox ID="txtCustomerName" runat="server" />
    </p>
    <p>
        <asp:Button ID="btnSearch" Text="Search" OnClick="btnSearch_Click"  runat="server" />
    </p>
    <p>
        <asp:Repeater ID="rpCustomerList" runat="server" DataSource="<%# Model.CustomerList %>">
            <HeaderTemplate>
                <table>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td><%# Eval("Id") %></td>
                    <td><%# Eval("Name") %></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </p>
    <p>
        Page number: <asp:Label Text="<%# Model.PageNumber %>" runat="server" />
    </p>
    <p>
        <asp:LinkButton ID="lnkPrevPage" Text="<<" OnClick="btnPrevPage_Click" 
            Visible="<%# Model.PageNumber > 0 %>" runat="server"/>
        <asp:LinkButton ID="lnkNextPage" Text=">>" OnClick="btnNextPage_Click" 
            runat="server" />
        <asp:HiddenField ID="hdnPageNumber" runat="server" Value="<%# Model.PageNumber %>" />
    </p>
</asp:Content>
